package com.ferreiradelima;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class CalculadoraActivity extends Activity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		final Context cxt = this;
		Button b = (Button) findViewById(R.id.BTMensagem);
		final TextView tv = (TextView) findViewById(R.id.TVOla);

		final EditText edt = (EditText) findViewById(R.id.CampoNome);

		b.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				Toast.makeText(cxt, edt.getText(), Toast.LENGTH_LONG).show();
				tv.setText(edt.getText());
			}
		});

	}
}